package reflectdemo;

public class TestPerson {
    public static void main(String[] args) {
        //获取哦class类的对象
        Class<?> c1;
        try {
            c1=Class.forName("reflectdemo.Person");
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
        Class<?> c2;
        c2= Person.class;
        Person person=new Person();
        Class<?> c3;
        c3=person.getClass();
        //Person类在JVM中只会有一份实例
        System.out.println(c1==c2);
        System.out.println(c1==c3);
        System.out.println(c2==c3);
    }
}
